package main

import (
	"github.com/gin-gonic/gin"
)

func main() {
	InitGlobal()
	router := gin.Default()
	router.LoadHTMLGlob("templates/*.html")
	router.GET("/", IndexController)
	router.GET("/simple/:name/", SimpleController)
	for _, simple := range Global.Simples {
		if simple.Prefix == "" {
			continue
		}
		router.GET(simple.Prefix+"/*path", PackageController)
	}
	router.Run()
}
